/*
 * @Descripttion:
 * @Author: Wang Dejiang(aei)
 * @Date: 2022-08-02 21:45:04
 * @LastEditors: arvin(王德江)
 * @LastEditTime: 2022-08-25 22:04:06
 */
/* eslint-disable */
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import service from '@/utils/request'
// import StackTracey from 'stacktracey'
import VueLazyload from 'vue-lazyload'
import 'comtoolcss'
import '@/assets/css/base.css'
import '@/assets/font/iconfont.css'
import defalImg from '@images/pic_029.gif'
import store from './store/store'
import 'nprogress/nprogress.css'
import upperFirst from 'lodash/upperFirst'
import camelCase from 'lodash/camelCase'
import Vuelidate from 'vuelidate'
import DateFilter from './filters/date'
import huakuai from 'huakuai-vue'
import myRecord from './mypPigin/index'
import revue, { topic } from 'revue-monitor'
Vue.use(huakuai)
Vue.use(Vuelidate)
Vue.filter('date', DateFilter)

Vue.config.productionTip = false
Vue.prototype.$req = service
const requireComponent = require.context(
  './components/Blog',
  false,
  /Base[A-Z]\w+\.(vue|js)$/
)
// webpacke特征，搜寻components,且搜寻子文件夹，匹配base开头且vue结尾的文件

requireComponent.keys().forEach((fileName) => {
  const componentConfig = requireComponent(fileName)
  // keys() gets us an array of each file so we can iterate through each and then get the object exported using requireComponent
  //  so we can globally register each

  // We may have file names like BaseIcon.vue(PascalCase) or base-icon.vue (kebab-case).
  // If the name is base-icon.vue, we need to convert it to PascalCase,
  // which will allow the component to be referenced as both PascalCase (e.g. <BaseIcon/>) or kebab-case (e.g. <base-icon/>)
  const componentName = upperFirst(
    camelCase(fileName.replace(/^\.\/(.*)\.\w+$/, '$1'))
  )

  // we’re using our lodash functions to uppercase the first character of our fileName
  // as well as camelCase the following word in the fileName

  Vue.component(componentName, componentConfig.default || componentConfig)
})

Vue.use(VueLazyload, {
  loading: defalImg,
})

revue.registLifecallBack('onJsError', myRecord)

// 我们的插件
Vue.use(revue.immediate)


// Vue.use(ComponentBlank.immediate)
// Vue.use(ComponentMount.immediate)
// Vue.use(timing.immediate)
// Vue.use(jsError)


Vue.use(ElementUI)

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount('#app')
